<template>
	<view class="reset-success">
		<uv-navbar left-icon-color="#fff" placeholder />
		
		<view class="reset-success_bar" />
		<view class="flex-center flex-col">
			<uv-image :src="`${$imageBaseUrl}reset-success.png`" width="272rpx" height="262rpx" />
			
			<text class="block reset-success-title text-48 pt-55">密码重置成功</text>
			<text class="block reset-success-tip pt-25 text-32">{{ countdownTime }}s 后重新登录，请使你的新密码登录</text>
		</view>
	</view>
</template>

<script setup>
	
	import { imgPath } from '@/common/config.js'
	
	import { ref } from 'vue'
	import { onLoad, onShow } from "@dcloudio/uni-app"
	
	import { useCountdown } from './lib/countdown.js'
	
	let mobile = ref('')
	
	function backClick() {
		uni.$fui.href('/pages/account/login', { mobile: mobile.value })
		mobile.value = ''
	}
	
	let countdownTime = ref(0)
	let { countdown, clearCountdown } = useCountdown(countdownTime, backClick)
	
	onLoad(opt => {
		uni.$fui.toast('重置密码成功~')
		countdownTime.value = 3
		mobile.value = opt.mobile
		countdown()
	})
	
</script>

<style>page{background-color: #fff}</style>
<style scoped lang="scss">
	.reset-success_bar{height: 160rpx}
	.reset-success-title{color: #3A3F5E}
	.reset-success-tip{color: #626780}
</style>